{extend name="public:base" /}
{block name="css"}
<link href="/static/laydate/theme/default/laydate.css">
{/block}
{block name="content"}
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox ">
                <div class="ibox-content">
                    <div class="row search-form">
                        <div class="col-sm-2 m-b-sm">
                            <div class="input-group">
                                <input placeholder="请输入用户名或手机号" name="user" value="{:input('user')}" type="text" class="form-control form-control-lg">
                            </div>
                        </div>

                        <div class="col-sm-2 m-b-sm">
                            <div class="input-group">
                                <input placeholder="请输入车牌号或车型" name="car" value="{:input('car')}" type="text" class="form-control form-control-lg">
                            </div>
                        </div>
                        <div id="ID-laydate-range" class="row col-sm-4 m-b-sm">
                            <div class="col-sm-6 m-b-sm">
                                <div class="input-group">
                                    <input placeholder="请选择支付开始日期" type="text" autocomplete="off" name="start_date" id="start_date" value="{:input('start_date')}" class="form-control form-control-lg" readonly>
                                </div>
                            </div>
                            <div class="col-sm-6 m-b-sm">
                                <div class="input-group">
                                    <input placeholder="请选择支付结束日期" type="text" autocomplete="off" name="end_date" id="end_date" value="{:input('end_date')}" class="form-control form-control-lg" readonly>
                                </div>
                            </div>
                        </div>
                        <button type="button" class="btn btn-primary btn-lg screen-btn">搜索</button>
                    </div>
                    <div class="table-responsive">
                        <table class="table table-striped">
                            <thead>
                            <tr>
                                <th>ID</th>
                                <th>订单号</th>
                                <th>用户</th>
                                <th>车辆</th>
                                <th>金额</th>
                                <th>类型</th>
                                <th>租用时间</th>
                                <th>状态</th>
                                <th>支付时间</th>
                                <th>创建时间</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            {volist name="list" id="vo"}
                            <tr>
                                <td>{$vo.id}</td>
                                <td>{$vo.order_sn}</td>
                                <td>{$vo.username} / {$vo.mobile}</td>
                                <td>{$vo.number} / {$vo.model}</td>
                                <td>{$vo.price}</td>
                                <td>{$vo.type == 1 ? '新开' : '续费'}</td>
                                <td>{$vo.start_time} - {$vo.end_time}</td>
                                <td>{$vo.status|doOrderStatus}</td>
                                <td>{:timeFormat($vo.pay_time)}</td>
                                <td>{:timeFormat($vo.create_time)}</td>
                                <td class="project-actions">
                                    {if $vo.status == 2 && (!$vo.start_time && !$vo.end_time)}
                                    <a href="{:url(startTiming, ['id' => $vo.id])}" data-msg="您确认现在开始计时吗？" class="btn btn-white btn-sm ajax-operate"><i class="iconfont icon-zhongxinhuida"></i> 开始计时 </a>
                                    {/if}
                                </td>
                            </tr>
                            {/volist}
                            </tbody>
                        </table>
                        {if !empty($list)}{$list->render()}{/if}
                    </div>

                </div>
            </div>
        </div>
    </div>
</div>

{/block}

{block name="js"}
<script src="/static/laydate/laydate.js"></script>
<script>
    laydate.render({
        elem: '#ID-laydate-range',
        range: ['#start_date', '#end_date']
    });
</script>
{/block}

